<% const types = {integer_int32: 'Integer', integer_int64: 'Long', string: 'String', boolean: 'Boolean', 'string_date': 'LocalDate', 'string_date-time': 'LocalDateTime'} %>
<% const hasDate = Object.values(properties).some(property => property.type === 'date') %>
<% const hasDateTime = Object.values(properties).some(property => property.type === 'datetime') %>
package <%= packageName %>.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.snakeCameName;
import lombok.Data;

<% if (hasDate) {%>
import java.time.LocalDate;
<% } %>
<% if (hasDateTime) {%>
import java.time.LocalDateTime;
<% } %>

@Data
@TableName("<%= snakeCameName %>")
public class <%= upperFirstCamelCaseName %> {

  <% Object.values(properties).forEach(function(property){ %>
  <% if (property.primaryKey) { %>
  @TableId()
  <% } else { %>
  @TableField("<%= property.snakeCaseName %>")
  <% } %>
  <% const _type = property.type !== 'array' ? (types[`${property.type}${property.format ? `_${property.format}` : ''}`]) : (types[`${property.items.type}${property.items.format ? `_${property.items.format}` : ''}`]) %>
  <% const type = property.type === 'array' ? `Array<${_type}>` : _type %>
  private <%- type %> <%= property.camelCaseName %>;
  <% }); %>
}